package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Abmqfwno type
*/
@SuppressWarnings("ALL")
public class Abmqfwno {


        private static volatile Abmqfwno instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Abmqfwno getInstance() {
            if (instance == null) {
                synchronized (Abmqfwno.class) {
                    if (instance == null) {
                        instance = new Abmqfwno();
                    }
                }
            }
            return instance;
        }


        private Abmqfwno() {

        }



    public  Boolean judgeZmjqgfhajf(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKlchhfqfle(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeHfvgvfjrkg(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLydvgeyxad(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePrmbsixpcm(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKeztrjlacd(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeUubdtersba(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOutyyoeqis(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKivddgkslo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeJtcuzxbonb(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  zmjqgfhajf;
    private String  klchhfqfle;
    private String  hfvgvfjrkg;
    private String  lydvgeyxad;
    private String  prmbsixpcm;
    private String  keztrjlacd;
    private String  uubdtersba;
    private String  outyyoeqis;
    private String  kivddgkslo;
    private String  jtcuzxbonb;


    public void setZmjqgfhajf(String zmjqgfhajf){
    this.zmjqgfhajf = zmjqgfhajf;
    }

    public String getZmjqgfhajf(){
    return this.zmjqgfhajf;
    }
    public void setKlchhfqfle(String klchhfqfle){
    this.klchhfqfle = klchhfqfle;
    }

    public String getKlchhfqfle(){
    return this.klchhfqfle;
    }
    public void setHfvgvfjrkg(String hfvgvfjrkg){
    this.hfvgvfjrkg = hfvgvfjrkg;
    }

    public String getHfvgvfjrkg(){
    return this.hfvgvfjrkg;
    }
    public void setLydvgeyxad(String lydvgeyxad){
    this.lydvgeyxad = lydvgeyxad;
    }

    public String getLydvgeyxad(){
    return this.lydvgeyxad;
    }
    public void setPrmbsixpcm(String prmbsixpcm){
    this.prmbsixpcm = prmbsixpcm;
    }

    public String getPrmbsixpcm(){
    return this.prmbsixpcm;
    }
    public void setKeztrjlacd(String keztrjlacd){
    this.keztrjlacd = keztrjlacd;
    }

    public String getKeztrjlacd(){
    return this.keztrjlacd;
    }
    public void setUubdtersba(String uubdtersba){
    this.uubdtersba = uubdtersba;
    }

    public String getUubdtersba(){
    return this.uubdtersba;
    }
    public void setOutyyoeqis(String outyyoeqis){
    this.outyyoeqis = outyyoeqis;
    }

    public String getOutyyoeqis(){
    return this.outyyoeqis;
    }
    public void setKivddgkslo(String kivddgkslo){
    this.kivddgkslo = kivddgkslo;
    }

    public String getKivddgkslo(){
    return this.kivddgkslo;
    }
    public void setJtcuzxbonb(String jtcuzxbonb){
    this.jtcuzxbonb = jtcuzxbonb;
    }

    public String getJtcuzxbonb(){
    return this.jtcuzxbonb;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}